package com.cn.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.cn.busi.StuController;
import com.cn.model.Stu;


/**
 * 用户模型MAPPER
 * 
 * @author 张顺利
 */

@Mapper
public interface StuMapper {
	
	
	
	/**
	 * 添加学生
	 * 
	 * @param user
	 */
	@Insert("insert into student(id,name,age) value (#{id}, #{name},#{age}) ")
	
	void addStu (Stu stu) ;	
	
	/**
	 * 删除学生
	 * @param id
	 */
	
	@Delete("delete from student where id = #{id} and name = #{name}")
	void delStu(Map<String, String> map);
	
	/**
	 * 删除学生
	 * @param id
	 */
		
	@Update("update student set age = #{age}  where  id = #{id} and name = #{name}")
	void updataStu(Map map);
	
	
	/**
	 * 查询学生
	 * @param id
	 */
		
	@Select("select*from student")
	
	List<Stu> getStu();

}
